package com.neuedu.his.controller;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import com.neuedu.his.entity.Prescription;
import com.neuedu.his.service.PrescriptionService;


@RestController
@RequestMapping("/prescription")
public class PrescriptionController {

	@Autowired
	private PrescriptionService service;
	
	@RequestMapping("/selectAll")
	// http://localhost:8088/prescription/selectAll
	public List<Prescription> selectAll(Prescription u) {
		return service.selectAll(u);
	}
	
	@RequestMapping("/selectById")
	// http://localhost:8088/prescription/selectById?id=1
	public List<Prescription> selectById(Prescription u) {
		return service.selectById(u);
	}
	
	@RequestMapping("/add")
	// http://localhost:8088/prescription/add?medicalid=20&registid=38&Userid=8&prescriptionname=小儿感冒&prescriptiontime=2019-11-11&prescriptionstate=2
	public int add(Prescription u) {
		return service.add(u);
	}

	@RequestMapping("/delete")
	// http://localhost:8088/prescription/delete?id=59
	public int delete(Prescription u) {
		return service.delete(u);
	}
}
